﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.CodeDom;

namespace devtm.Templates.Helpers
{
    public class MyRefStatement : CodeVariableDeclarationStatement
    {

        public MyRefStatement() : base() { }

        public MyRefStatement(MyRef reference) : base(reference.Type, reference.VariableName)
        {
            Ref = reference;
        }

        public MyRefStatement(MyRef reference, CodeExpression initExpression)
            : base(reference.Type, reference.VariableName, initExpression)
        {
            Ref = reference;
        }

        public MyRefStatement(MyType type, string name) : base(type, name) 
        {
            Ref = new MyRef(name, type);
        }

        public MyRefStatement(string type, string name) : base(type, name) 
        {
            Ref = new MyRef(name, type);
        }

        public MyRefStatement(Type type, string name) : base(type, name) 
        {
            Ref = new MyRef(name, type);
        }

        public MyRefStatement(MyType type, string name, CodeExpression initExpression) : base(type, name, initExpression) 
        {
            Ref = new MyRef(name, type.TypeExpression.Clone());
        }

        public MyRefStatement(string type, string name, CodeExpression initExpression) : base(type, name, initExpression) 
        {
            Ref = new MyRef(name, type);
        }

        public MyRefStatement(Type type, string name, CodeExpression initExpression) : base(type, name, initExpression) 
        {
            Ref = new MyRef(name, type);
        }


        public MyRef Ref { get; set; }
    }
}
